﻿@using System.Web.UI.WebControls
@using DevExpress.Web.ASPxGridView
@using DevExpress.Web.Mvc.UI
@using Dogshow.Model

@Html.DevExpress().GridView(s =>
{
    s.Name = "gvMesta";
    s.Caption = "Mesta";
    s.KeyFieldName = "Id";
    s.Width = Unit.Percentage(100);
    s.SettingsBehavior.AllowClientEventsOnLoad = false;
    s.SettingsBehavior.AllowFocusedRow = true;
    s.SettingsBehavior.EnableRowHotTrack = true;
    s.Columns.Add("Id").Visible = false;
    s.Columns.Add("PostanskiBroj", "Poštanski broj").Width = Unit.Pixel(50);
    s.Columns.Add("Naziv", "Naziv mesta");
    s.CallbackRouteValues = new {Controller = "Mesta", Action = "VratiMesta"};
    s.SettingsPager.PageSize = 25;
    s.SettingsPager.Mode = GridViewPagerMode.ShowPager;
    s.SettingsPager.NumericButtonCount = 5;
    s.Settings.ShowFilterRow = true;
    s.ClientSideEvents.FocusedRowChanged = "onFocusedRowChanged";
    s.SettingsLoadingPanel.Text = "Učtavam podatke...";
}).Bind(ViewBag.SifarnikMesta).GetHtml()